import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import ConfigElementType 1.0
import "qrc:/qmlComponents/ConfigManager"
import "qrc:/qmlComponents/AxisModulePos"
import "qrc:/qmlComponents/VisionViewer"
import "qrc:/qmlComponents/CustomizedUIElement"

Item {
    RowLayout{
        spacing: 30

        ColumnLayout{
            spacing: 10
            Layout.alignment: Qt.AlignTop

            SAxisModulePos{
                moduleName: "LTBufferBeltZ"
                posName: "LoadTrayPos"
            }
            SAxisModulePos{
                moduleName: "LTBufferBeltZ"
                posName: "UnloadTrayPos"
            }
            SAxisModulePos{
                moduleName: "LTBufferBeltZ"
                posName: "SafetyPosUponLTL"
            }
        }

        ColumnLayout{
            spacing: 10
            Layout.alignment: Qt.AlignTop

            ConfigRow{
                configName: "ltBufferBeltRunDir"
                configModel: ltModuleConfig
                Component.onCompleted: {
                    init(ConfigElementType.Other)
                }
            }
            ConfigRow{
                configName: "detectHasTrayMaxTime"
                configModel: ltModuleConfig
                Component.onCompleted: {
                    init(ConfigElementType.Int)
                }
            }
            ConfigRow{
                configName: "ltBufferGetTrayTimeout"
                configModel: ltModuleConfig
                Component.onCompleted: {
                    init(ConfigElementType.Int)
                }
            }

            Button{
                text: qsTr("LoadTray")
                onClicked: {
                    lensTrayLoader.handleDebugEvent("lensTrayBufferManuallyLoadTray")
                }
            }
        }
    }
}
